<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?=$web_title?></title>
<LINK href="<?=$www_site_url?>/public/yav-style.css" type=text/css rel=stylesheet>
<script src="<?=$www_site_url?>/public/js/yav2.0/yav.js"></script>
<script src="<?=$www_site_url?>/public/js/yav2.0/yav-config-zh-CN.js"></script>
<script src="<?=$www_site_url?>/public/js/md5.js"></script>
<SCRIPT>
//only for test purposes
var _key = "<?=$_XpassSignKey?>";
function checkOnSubmit(formName, r) {
  
    if (yav.performCheck(formName, r, 'inline')) {
    	document.getElementById(formName).password.value = hex_md5(document.getElementById(formName).password.value);
    	document.getElementById(formName).s.value = hex_hmac_md5(_key,document.getElementById(formName).password.value);
        return true;
    } 
    return false;
}

var rules=new Array();

rules[0]='user|required';
rules[1]='password|required';
<? if($show_code){?>
rules[2]='code|required';
<? }?>


yav.addHelp('user', '请输入您的帐号：电子邮箱');
yav.addHelp('password', '请输入您的密码');



</SCRIPT>

</head>
<body onload="yav.init('loginform', rules);">
<h1> <?=$web_title?></h1>
<FORM name="loginform" id="loginform" method="POST" onsubmit="return checkOnSubmit('loginform', rules);" >
<input type="hidden" name="action" value="passport">
<input type="hidden" name="op" value="dologin">
<input type="hidden" name="forward" value="<?=$forward?>">
<input type="hidden" name="s" id="s" value="">
<TABLE valign=top>

<TR><TD>帐号:</TD><TD><INPUT type="text" name="user" value="用户邮箱/用户名" onfocus="this.value='';"/>&nbsp;&nbsp;<span id="errorsDiv_user"></span></TD></TR>
<TR><TD>密码:</TD><TD><INPUT type="password" name="password" />&nbsp;&nbsp;<span id="errorsDiv_password"></span></TD></TR>
<? if($show_code>3){?>
<TR><TD></TD><TD><img id="codeimg" src="<?=$www_site_url?>/index.php/identifycode/generate" align="absmiddle" title="换一张" onClick="changeCode();" style="cursor:pointer"> <span onClick="changeCode();" style="cursor:pointer">看不清</span></TD></TR>
<TR><TD>验证码:</TD><TD><INPUT type="text" name="code" />&nbsp;&nbsp;<span id="errorsDiv_code"></span></TD></TR>
<? }?>
<TR><TD>&nbsp;</TD><TD><INPUT type="checkbox" name="remember" value="1"/> 记住我&nbsp;&nbsp;<span id="errorsDiv_remember"></span></TD></TR>

<TR><TD colspan="2"><INPUT type=submit value="登录" /> <INPUT type="button" value="注册" onclick="window.location.href='/index.php/passport/reg'" /> <INPUT type="button" value="忘记密码" onclick="window.location.href='/index.php/passport/forget'" /><br></TD><TD></TD></TR>
</TABLE>
</form>
</body>
</html>